package jdk8的特性.Stream.谓词筛选;


import jdk8的特性.Stream.跳过元素.User;

import java.util.List;
import java.util.stream.Collectors;

import static jdk8的特性.Stream.跳过元素.MockDB.mockUserList;

/**
 * 对于jdk8里面的谓词操作
 *
 * @author idea
 * @data 2018/9/8
 */
public class Test {

    public static void main(String[] args) {
        List<User> userList = mockUserList(10);
        userList.stream()
                .filter(User::isGril)
                .collect(Collectors.toList());
        userList.forEach((user) -> {
            System.out.println(user.getSex());
        });
    }

}
